package com.ljh.ad.runner;

import com.ljh.ad.mysql.BinlogClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

/**
 * Created by Qinyi.
 */
@Slf4j
@Component
public class BinlogRunner implements CommandLineRunner {

    private final BinlogClient client;

    private final KafkaTemplate<String, String> kafkaTemplate;

    @Autowired
    public BinlogRunner(BinlogClient client, KafkaTemplate<String, String> kafkaTemplate) {
        this.client = client;
        this.kafkaTemplate = kafkaTemplate;
    }

    @Override
    public void run(String... strings) throws Exception {

        log.info("Coming in BinlogRunner...");
        /*
        *
        *
        * */
        client.connect();
    }
}
